public class class4 {
    import java.util.ArrayList;
import java.util.Date;
import java.util.List;

    class Customer {
        String name;
        String contact;
        String deliveryAddress;
        boolean active;
        List<Order> orders = new ArrayList<>();
    }

    class Order {
        Date createDate;
        String status; // CREATE, PAID, SHIPPING, DELIVERED, CANCEL
        List<OrderDetail> orderDetails = new ArrayList<>();
        Payment payment;
        Customer customer;
    }

    class OrderDetail {
        int quantity;

        double calculateSubTotal() {
            // Implement calculation logic
            return 0;
        }

        double calculateWeight() {
            // Implement calculation logic
            return 0;
        }
    }

    class Product {
        String title;
        double weight;
        String description;

        double getPriceForQuantity(int quantity) {
            // Implement price logic
            return 0;
        }

        double getWeight() {
            return weight;
        }
    }

    abstract class Payment {
        double amount;
    }

    class Credit extends Payment {
        String number;
        String type;
        Date expireDate;
    }

    class Cash extends Payment {
        double cashTendered;
    }

    class WireTransfer extends Payment {
        String bankID;
        String bankName;
    }

    class AliPay extends Payment {
        String number;
    }

    class WeixinPay extends Payment {
        String number;
    }
}


